﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<z.m.db.UserProfile>" %>
<% if (ViewData["type"] == "header") {%>
<tr>
	<td><%: Html.LabelFor(m=>m.UserId) %></td>
	<td><%: Html.LabelFor(m=>m.UserName)%></td>
	<td><%: Html.LabelFor(m=>m.webpages_Roles)%></td>
	<td><%: Html.LabelFor(m=>m.First_Name)%></td>
	<td><%: Html.LabelFor(m=>m.Last_Name)%></td>
	<td><%: Html.LabelFor(m=>m.Phone)%></td>
	<td colspan="99">Controll</td>
</tr>
<%}else{
	object att =new { };
	if (Model.CurrentRole == 1)
		att = new { @disabled = "disabled" };
	%>
<tr id="FormUser<%: Model.UserId %>" title="<%:Url.Action("_Adminster","User") %>">
	<td>
		<%: Html.TextBoxFor(m => m.UserId, new {readOnly=true})%>
	</td>
	<td>
		<%:Html.TextBoxFor(m => m.UserName,att)%>
		<%:Html.ValidationMessageFor(m => m.UserName)%>
	</td>
	<td>
		<%:Html.Partial("~/Views/Role/Selector.aspx", viewData: new ViewDataDictionary() {{"RoleID",Model.CurrentRole}}) %>
	</td>
	<td>
		<%:Html.TextBoxFor(m => m.First_Name,att)%>
		<%:Html.ValidationMessageFor(m => m.First_Name)%>
	</td>
	<td>
		<%:Html.TextBoxFor(m => m.Last_Name,att)%>
		<%:Html.ValidationMessageFor(m => m.Last_Name)%>
	</td>
	<td>
		<%:Html.TextBoxFor(m => m.Phone,att)%>
		<%:Html.ValidationMessageFor(m => m.Phone)%>
	</td>
	<td>
		<input type="button" value="Save" onclick="ajaxTrSubmit(event);" <%:Model.CurrentRole ==1 ? "disabled" : ""%>/>
	</td>
</tr>
<%} %>